﻿@model DeliveryManage.Model.Sys_Navigation
@{
    Layout = null;
    DeliveryManage.Models.ReturnMsgModel returnMsg = ViewBag.ReturnMsgModel;
}

<!DOCTYPE html>
<html class="x-admin-sm">
<head>
    <meta charset="UTF-8">
    <title>编辑子级菜单</title>
    <meta name="viewport" content="width=device-width" />
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <link rel="stylesheet" href="~/Content/font.css">
    <link rel="stylesheet" href="~/Content/framemain.css">
    <link href="~/Content/icon/iconfont.css" rel="stylesheet" />
    <link rel="stylesheet" href="~/Content/layui/css/modules/layer/default/layer.css" />
    <script type="text/javascript" src="~/Scripts/jquery-3.3.1.min.js"></script>
    <script type="text/javascript" src="~/Content/layui/layui.js" charset="utf-8"></script>
    <script type="text/javascript" src="~/Scripts/framemain.js"></script>
    <script type="text/javascript" src="~/Scripts/laymain.js"></script>
    <script src="~/Scripts/jquery.unobtrusive-ajax.js"></script>

    <style>
        .layui-form-label {
            width: 100px;
        }

        .layui-form-item .layui-input-inline {
            width: 300px;
        }

        .editor {
            margin: 0px;
            width: 436px;
            height: 339px;
        }

        .check {
            width: 100px !important
        }
    </style>
    <script type="text/javascript">
        $(function () {
            //操作提示
            if (@returnMsg.code == 400) {
                layer.msg('@returnMsg.msg', { icon: 5, title: '提示' }, function (index) {
                  layer.close();
                })
            }
            $(document).ready(function () {
                $("#myfrom").submit(function () {
                    var data = $(this).serialize();
                    layer.confirm('确认提交吗?', { icon: 3, title: '提示' }, function (index) {
                        $.ajax({
                            type: "POST",
                            url: "/System/SysNavigationEdit",
                            data: data,
                            success: function (obj) {
                                if (obj.status == true) {
                                    layer.msg(obj.msg, { icon: 6, title: '提示' }, function (index) {
                                        window.parent.window.location.href = '/System/SysNavigation';
                                    });
                                } else {
                                    layer.msg(obj.msg, { icon: 5, title: '提示' }, function (index) {
                                        layer.close();
                                        location.reload();
                                    });
                                }
                            }
                        })
                        layer.close();
                    });
                    return false;

                })
            })
        });
    </script>
</head>
<body>
    <form id="myfrom" class="tab-content layui-form" action="" lay-filter="example">

        @{
            if (returnMsg.code == 200)
            {
                @Html.HiddenFor(m => m.id)
                @Html.Hidden("AddOrEdit", (string)ViewBag.AddOrEdit)

                <div class="layui-fluid">
                    <div class="layui-row">
                        <div class="layui-form-item">
                            <label class="layui-form-label">
                                <span class="x-red">*</span>视图名称
                            </label>
                            <div class="layui-input-inline">
                                @Html.TextBoxFor(m => m.name, new { @datatype = "s2-100", @class = "layui-input normal", @sucmsg = " " })
                            </div> <span class="x-red">*视图名称首字母大写</span>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">
                                <span class="x-red">*</span>父级菜单
                            </label>
                            <div class="layui-input-inline">
                                @Html.DropDownListFor(m => m.parent_id, ViewData["parentlist"] as SelectList, new { @class = "layui-input layui-select", id = "parent_id", @lay_filter = "parent_id", })
                            </div> <span class="x-red">*必须选择父级菜单</span>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">
                                <span class="x-red">*</span>下级菜单
                            </label>
                            <div class="layui-input-inline">
                                @Html.TextBoxFor(m => m.sub_title, new { @datatype = "s2-100", @class = "layui-input normal", @sucmsg = " " })
                            </div> <span class="x-red">*下级菜单不能超过4个字符</span>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">
                                <span class="x-red">*</span>跳转链接
                            </label>
                            <div class="layui-input-inline">
                                @Html.TextBoxFor(m => m.link_url, new { @class = "layui-input normal" })
                            </div> <span class="x-red">*请输入跳转链接</span>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">
                                <span class="x-red">*</span>排序
                            </label>
                            <div class="layui-input-inline">
                                @Html.TextBoxFor(m => m.sort_id, new { @class = "layui-input normal" })
                            </div> <span class="x-red">*排序只能输入数字类型</span>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">
                                <span class="x-red">*</span>操作权限
                            </label>
                            <div class="layui-input-inline">
                                <div class="multi-checkbox">
                                    <table class="layui-form">
                                        <tr>
                                            <td class="check"><input type="checkbox" name="Show" lay-skin="primary" class="checkall" @((string)ViewBag.Show == "Show" ? " checked=\"checked\"" : "") title="查看"/></td>
                                            <td class="check"><input type="checkbox" name="View" lay-skin="primary" class="checkall" @((string)ViewBag.View == "View" ? " checked=\"checked\"" : "") title="显示"/></td>
                                            <td class="check"><input type="checkbox" name="Add" lay-skin="primary" class="checkall" @((string)ViewBag.Add == "Add" ? " checked=\"checked\"" : "") title="增加"/></td>
                                        </tr>
                                        <tr>
                                            <td class="check"><input type="checkbox" name="Edit" lay-skin="primary" class="checkall" @((string)ViewBag.Edit == "Edit" ? " checked=\"checked\"" : "") title="修改"/></td>
                                            <td class="check"><input type="checkbox" name="Delete" lay-skin="primary" class="checkall" @((string)ViewBag.Delete == "Delete" ? " checked=\"checked\"" : "") title="删除"/></td>
                                            <td class="check"><input type="checkbox" name="Audit" lay-skin="primary" class="checkall" @((string)ViewBag.Audit == "Audit" ? " checked=\"checked\"" : "") title="审核"/></td>
                                        </tr>
                                    </table>
                                </div>
                            </div> <span class="x-red">*排序只能输入数字类型</span>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">
                                <span class="x-red">*</span>开放状态
                            </label>
                            <div class="layui-input-inline">
                                <div class="layui-form">
                                    <input type="radio" name="is_lock" value="0" @(Model.is_lock == 0 ? "checked=\"checked\"" : "") />开放
                                    <input type="radio" name="is_lock" value="1" @(Model.is_lock == 1 ? "checked=\"checked\"" : "") />关闭
                                </div>
                            </div>
                            <span class="x-red">是否开放显示状态，默认关闭</span>
                        </div>

                        <div class="layui-form-item">
                            <label class="layui-form-label">
                                <span class="x-red"></span>
                            </label>
                            <div class="layui-input-inline">
                                <input id="btnSubmit" name="btnSubmit" type="submit" value="保存信息" class="layui-btn" />
                            </div>
                        </div>
                    </div>
                </div>
            }
        }
    </form>

    <script>
        layui.use(['form', 'layer'],
            function () {
                $ = layui.jquery;
                var form = layui.form,
                    layer = layui.layer;
            });
    </script>
</body>
</html>
